<?php

namespace common\models\db\tables;

use Yii;

/**
 * This is the model class for table "{{%sms_log}}".
 *
 * @property int $id
 * @property string $component_id 发送信息组件
 * @property int $type 信息类型
 * @property string $msg 发送的信息
 * @property string|null $to_phone 发送的手机号
 * @property int|null $created_by 创建者
 * @property int|null $updated_by
 * @property int $created_at
 * @property int $updated_at
 * @property int $deleted_at
 * @property int $status
 */
class SmsLog extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%sms_log}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['component_id', 'type', 'msg', 'to_phone', 'created_by', 'updated_by', 'created_at', 'updated_at', 'deleted_at', 'status'], 'trim'],
            [['component_id', 'type', 'msg', 'created_at', 'updated_at', 'deleted_at', 'status'], 'required'],
            [['type', 'created_by', 'updated_by', 'created_at', 'updated_at', 'deleted_at', 'status'], 'integer'],
            [['msg'], 'string'],
            [['component_id'], 'string', 'max' => 50],
            [['to_phone'], 'string', 'max' => 180],
            [['to_phone', 'created_by', 'updated_by'], 'default', 'value' => null],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'component_id' => Yii::t('app', '发送信息组件'),
            'type' => Yii::t('app', '信息类型'),
            'msg' => Yii::t('app', '发送的信息'),
            'to_phone' => Yii::t('app', '发送的手机号'),
            'created_by' => Yii::t('app', '创建者'),
            'updated_by' => Yii::t('app', 'Updated By'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
            'deleted_at' => Yii::t('app', 'Deleted At'),
            'status' => Yii::t('app', 'Status'),
        ];
    }
}
